1. Field of the Invention
The present invention relates to a bar code scanner for reading bar codes. More particularly, the present invention relates to a sensitivity adjustment circuit suitable for a touch type bar code scanner.
2. Description of the Related Art
A line type sensor is generally used in a touch type bar code scanner. A CCD sensor is a typical example of a line type sensor. This line type CCD sensor comprises a photoelectric conversion section in which a great number of photodiodes, which are photoreceptors, are arrayed linearly; a section for storing the charge of each photodiode; and a charge transfer section formed of CCDs in steps, the number corresponding to the number of photodiodes. The photoelectric conversion section converts light entering from outside into an amount of charge corresponding to the amount of light. The charge storing section temporarily stores the charge obtained by the photoelectric conversion section and transfers it all at once to the charge transfer section when a start pulse is applied. The charge transfer section transfers the charge transferred from the charge storing section step by step each time a clock pulse is applied, and causes the CCD sensor to output timed serial signals.
In this case, the amplitude value of the serial signals obtained by the CCD sensor corresponds to the amount of charge stored in the charge storing section.. The amount of charge depends on the amount of time from when a start pulse is applied until the next start pulse is applied, namely, the so-called accumulation time.
When the photoreception sensitivity of the CCD sensor is fixed, the amplitude of the serial signals is influenced by the environment in which the CCD sensor is used, for example, by the density of colors of the printed bar codes, the light reflectance of the paper surface on which the bar codes are printed, ambient brightness, and the bar code reading distance.
On the other hand, after the serial signals are amplified, they are binarized. When the amplitude of the serial signals is too large, it is impossible to correctly binarize the signals because they are saturated when amplified. When the amplitude of the serial signals is too small, a proper threshold level cannot be obtained at the time of binarization, making it impossible to correctly binarize the signals in the same manner as above.
Therefore, to correctly binarize the serial signals, in practice, it is necessary to properly adjust the photoreception sensitivity of the CCD sensor in accordance with the amplitude value of the serial signals according to the environment in which the CCD sensor is used.
The sensitivity adjustment circuit for a conventional bar code scanner will be explained below with reference to the block diagram shown in FIG. 4.
An LED array 1 has a construction in which a plurality of LEDs (light-emitting diodes) are arrayed linearly. The LED array 1 projects red light to a bar code 3. An LED drive circuit 2 drives the LED array at a constant current, and a CCD sensor 4 scans and detects light reflected from the bar code 3, and converts the light into serial electrical signals. A start circuit 5 actuates the various sections of the bar code scanner in response to a start signal and stops them in response to a reset signal. An amplification circuit 6 clamps serial signals from the CCD sensor 4 to invert and amplify the signals. A binarization circuit 7 converts the inverted and amplified serial signals into digital binary signals. A clock signal generating circuit 8 supplies an operation clock signal to the various sections and supplies a sensor clock signal, in which the frequency of the clock signal is divided, to the CCD sensor 4. A decoding count counter 9 counts the number of times in which a decode NG signal occurs, such signal occurring when decoding is impossible by a decoding circuit 17.
An accumulation time memory 10 stores a plurality of sensor clock values corresponding to the accumulation time of the CCD sensor 4 in such a manner as to correspond to respective addresses. An accumulation time comparison circuit 11 compares the sensor clock value of the accumulation time memory 10 with the count value of an accumulation time counter 12, outputs a pulse signal when the value of the former becomes greater than that of the latter, and at the same time supplies a reset signal to the accumulation time counter 12 so as to reset the accumulation time count value. The accumulation time counter 12 counts sensor clock signals from the clock signal generating circuit 8. A timing signal generating circuit 13 generates a start pulse in response to a pulse signal from the accumulation time comparison circuit 11. A decoding count comparison circuit 14 compares the decoding count value of the decoding count counter 9 with the value of a set value memory 15. When these values are the same, a termination signal is generated from the number of decodings comparison circuit 14. The set value memory 15 stores constant values corresponding to the number of decodings. An address decoder 16 selects one of the stored values of the accumulation time memory 10 on the basis of the decoding count value of the decoding count counter 9. A decoding circuit 17 measures the pulse width of the digital signals binarized by the binarization circuit 7 in order to decode the signals into characters or numeric data corresponding to the pulse width combinations. The decoding circuit 17 supplies the characters or numeric data to a microcomputer 18 and outputs a decode NG signal when decoding fails. The microcomputer 18 controls the operation of the various sections of the bar code scanner, and an OR gate 19 supplies a reset signal to the start circuit 5.
The operation of the sensitivity adjustment circuit for the bar code scanner constructed as described above will now be explained with reference to FIG. 5. For reference, an example of the signals of the various sections of the bar code scanner within one accumulation time in FIG. 5 is shown in FIG. 6.
FIG. 5 is a signal waveform chart illustrating an example of the signals of the various sections of the bar code scanner when sensitivity adjustment is performed. FIG. 5(a) illustrates a start pulse; FIG. 5(b) illustrates a serial signal output from the CCD sensor 4; FIG. 5(c) illustrates a clamped/inverted and amplified output signal; and FIG. 5 (d) illustrates a binarized output signal.
FIG. 6 is a signal waveform chart illustrating an example of the signals of the various sections of the bar code scanner within one accumulation time. FIG. 6(a) illustrates a start pulse; FIG. 6(b) illustrates a clock signal; FIG. 6(c) illustrates a Serial signal output from the CCD sensor 4; FIG. 6(c) illustrates a sample hold output of the serial signal; and FIG. 6(e) illustrates a clamped/inverted and amplified output signal.
When the bar code scanner is powered on at time t.sub.0, the microcomputer 18 supplies a start signal to the start circuit 5. Thereupon, the start circuit 5 sends out a set signal to initialize the various sections of the bar code scanner and place them in an operating state. In this condition, the clock signal generating circuit 8 sends out an operation clock signal to the various sections of the bar code scanner and supplies a sensor clock signal to the CCD sensor 4 and the accumulation time counter 12.
The number of decodings counter 9 supplies an initial value (e.g., 0) of the decoding count value to the address decoder 16 where the address of an accumulation time memory A10, corresponding to the initial value (e.g., 0), is set. The accumulation time memory A10 supplies a value (e.g., 100) corresponding to the set address, to the accumulation time comparison circuit 11. The accumulation time counter 12 counts input sensor clock signals, and supplies the sensor count value to the accumulation time comparison circuit 11. The accumulation time comparison circuit 11, upon detecting that the accumulation time count value of the accumulation time counter 12 has exceeded the value (e.g., 100) corresponding to the address, supplies a pulse signal to the timing signal generating circuit 13 and a reset signal to the accumulation time counter 12. At this time, the timing signal generating circuit 13, in response to the pulse signal, supplies the first start pulse (FIG. 5(a)) to the CCD sensor 4. At the same time, the accumulation time count value of the accumulation time counter 12 up to that time is reset by the reset signal, and the accumulation time counter 12 starts to count sensor clock signals.
When the first start pulse is applied to the CCD sensor 4 at time t.sub.1, the CCD sensor 4 reads reflected light from the bar code 3 and outputs serial signals (FIG. 5(b)). After these serial signals are clamped/inverted and amplified by the amplification circuit 6 (FIG. 5(c)), the signals are converted into digital signals (FIG. 5(d)) by the binarization circuit 7, and sent out to the decoding circuit 17. As the serial signals obtained by the reading of the bar code 3 are those signals when the charge storing section of the CCD sensor 4 is not charged from time t.sub.0 to time t.sub.1, the amplitude thereof is very small and meaningless. Therefore, the decoding circuit 17 cannot decode the serial signals into proper characters or numerical data, and generates only a decode NG signal. Next, the decode NG signal is supplied to the number of decodings counter 9 where the decoding count value is increased by one (e.g., to 1).
Hereinafter, when the number of decodings counter 9 outputs the decoding count value (e.g., 1), the address decoder 16 sets the address of the accumulation time memory A10 corresponding to the decoding count value, the accumulation time memory A10 supplying a value (e.g., 2,500) corresponding to the set address to the accumulation time comparison circuit 11. Next, when the accumulation time comparison circuit 11 detects that the sensor count value of the sensor clock signal in the accumulation time counter 12 has exceeded the value (e.g., 2,500) corresponding to the address, the accumulation time comparison circuit 11 supplies a pulse signal to the timing signal generating circuit 13 and a reset signal to the accumulation time counter 12. Also, in this case, the timing signal generating circuit 13 supplies a second start pulse to the CCD sensor 4 in response to the pulse signal. The accumulation time count value of the accumulation time counter 12 is reset by the reset signal, and again the accumulation time counter 12 starts to count sensor clock signals.
When the second start pulse is applied to the CCD sensor 4 at time t.sub.2, serial signals output from the CCD sensor 4 pass through the amplification circuit 6 and the binarization circuit 7 in the same manner as described above, sent out as digital signals to the decoding circuit 17 where the signals are decoded. At the above time, the serial signals are obtained by reading the bar code 3 in the accumulation time A from time t.sub.1 to time t.sub.2. Because the charge stored up to that time in the charge storing section of the CCD sensor 4 is discharged in the accumulation time A, the amplitude thereof is very small and meaningless. This time also, the decoding circuit 17 cannot decode the serial signals into proper characters or numerical data, and generates only a decode NG signal. Next, this decode NG signal is supplied again to the decoding count counter 9, and the decoding count value of the decoding count counter 9 is further increased by one (e.g., to 2).
The operation to be performed hereinafter is the same as that described above. The decoding count value (e.g., 2) of the number of decodings counter 9 is output. The address of the accumulation time memory A10, corresponding to the decoding count value (e.g., 2) of the address decoder 16, is set. A value (e.g., 2,500) corresponding to the set address in the accumulation time memory A10 is supplied to the accumulation time comparison circuit 11. A pulse signal and a reset signal are generated from the accumulation time comparison circuit 11 when the accumulated time comparison circuit 11 detects that the count value of the sensor clock signal of the accumulated time counter 12 has exceeded the value (e.g., 2,500) corresponding to the set address. A third start pulse is generated from the timing signal generating circuit 13 in accordance with the pulse signal. The accumulation time count value of the accumulated time counter 12 is reset in accordance with the reset signal.
When the third start pulse is applied to the CCD sensor 4 at time t.sub.3, serial signals output from the CCD sensor 4 pass through the amplification circuit 6 and the binarization circuit 7, and are sent out to the decoding circuit 17 as digital signals in the same manner as described above. In this case, the serial signals obtained at this time by reading the bar code 3 are those signals in accumulation time B from time t.sub.2 to time t.sub.3. Even though the bar code 3 has been read normally, the decoding circuit 17 cannot decode the serial signals into normal characters or numerical data also at this time as the setting of the photoreception sensitivity of the CCD sensor 4 is still insufficient and the amplitude thereof is very small, and instead this circuit generates only a decode NG signal in the same manner as above. Next, the decode NG signal obtained at this point is supplied again to the number of decodings counter 9 where the decoding count value is increased by one (e.g., to 3).
Hereinafter in the same manner as described above, each time a decode NG signal is generated from the decoding circuit 17, the count value of the number of decodings counter 9 is increased by one. The sensor count value of the sensor clock signal in the accumulation time counter 12 is changed in accordance with an increase in the decoding count value. The accumulation time of the CCD sensor 4 is changed to accumulation time C or D shown in FIG. 5.
When a normal (optimum) decode signal is produced in the output of the decoding circuit 17, no decode NG signal is generated from the decoding circuit 17, and the decoding count value of the number of decodings counter 9 is kept at a count value the same as the preceding value. Hereinafter, the accumulation time of the CCD sensor 4 is kept at the accumulation time corresponding to the accumulation time count value. In this way, the adjustment of the photoreception sensitivity of the CCD sensor 4 is completed.
The number of times that the decoding count value of the number of decodings counter 9 can be changed in accordance with the decode NG signal from the decoding circuit 17 is limited to a number of times determined by the set number (e.g., 20) of the set value memory, for example, 20 times. When the adjustment of the photoreception sensitivity of the CCD sensor 4 is not completed even if the decoding count value has been changed 20 times, the number of decodings comparison circuit 14 generates a termination signal. This termination signal is supplied as a reset signal to the start circuit 5 through the OR gate 19, the start circuit 5 stopping the operation of the various sections of the bar code scanner and placing them in a waiting state.
In the above-described sensitivity adjustment circuit for the bar code scanner, a method is employed in which the accumulation time of the CCD sensor 4 is varied slightly each time the decode NG signal is supplied to adjust the bar code scanner to the optimum sensitivity. Therefore, it is usual that the number of times the above-mentioned scannings are performed increases by the time the optimum sensitivity adjustment is performed, and thus a longer time has to pass before it becomes possible to actually read the bar code 3. As a result, a problem arises, for example, the user of the bar code scanner is made irritable or uneasy.
In addition, it is impossible in this type of bar code scanner to set the accumulation time of the CCD sensor 4 to be a time shorter than the time it takes for the CCD sensor 4 to read the bar code 3. To read the bar code quickly, the above reading time must be shortened. For this purpose, a method is available in which the Clock signal frequency is made high to shorten the accumulation time of the CCD sensor 4. In practice, however, the clock signal frequency cannot be made so high due to limitations on the operation of the CCD sensor 4, on the response speed of other circuits in use and the like.
Therefore, a problem arises, for example, a sensitivity adjustment range sufficient for a bar code scanner cannot be obtained.